From e54060bac209f3a4bd5d52fb941de075a88484e3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 22 May 2020 13:17:59 -0400 Subject: [PATCH] gtk-demo: Fix entry position in dnd demo gtk_fixed_get_child_position does not work if children have transforms that are not just 2D translations. Use gtk_widget_translate_coordinates instead. --- demos/gtk-demo/dnd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/gtk-demo/dnd.c b/demos/gtk-demo/dnd.c index fb164e41a2..0d901af6de 100644 --- a/demos/gtk-demo/dnd.c +++ b/demos/gtk-demo/dnd.c @@ -309,9 +309,9 @@ edit_cb (GtkWidget *button, GtkWidget *child) GtkWidget *canvas = gtk_widget_get_parent (child); CanvasItem *item = CANVAS_ITEM (child); GtkWidget *entry; - int x, y; + double x, y; - gtk_fixed_get_child_position (GTK_FIXED (canvas), child, &x, &y); + gtk_widget_translate_coordinates (child, canvas, 0, 0, &x, &y); entry = gtk_entry_new (); -- 2.30.2